﻿using FyAutoStartService.Models;
using FySystem.Logs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;

namespace FyAutoStartService
{
    internal class Global
    {
        internal static JsonSerializerOptions JsonOpt = new JsonSerializerOptions()
        {
            Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping
        };

        internal static bool RunFlag = true;

        //所有自启程序
        internal static List<AppInfo> Apps = new List<AppInfo>();

        public static WSocketListenerHelper? Listener { get; internal set; }

        /// <summary>
        /// 文件传输工具类
        /// </summary>
        public static FileTransfer FileTransfer { get; set; }

        //相关配置
        public static string? Username { get; set; }

        public static string? Passwd { get; set; }

        /// <summary>
        /// 允许访问的根路径
        /// </summary>
        public static string? RootPath { get; internal set; }

        /// <summary>
        /// IP版本
        /// </summary>
        public static string Ipv { get; internal set; }

        /// <summary>
        /// 远程升级工具类
        /// </summary>
        public static UniversalUpgradeUtils UniversalAppUpdate { get; internal set; }
        public static string UniversalAppUpdatePath { get; internal set; }
    }
}
